package com.open.capacity.service.impl;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.mail.SimpleMailMessage;
import org.springframework.mail.javamail.JavaMailSender;
import org.springframework.stereotype.Service;

/**
 * 发送邮件的service实现类
 *
 * @author y022
 */
@Service
public class SendMailService {

    @Autowired
    private JavaMailSender javaMailSender;

    public void sendMail(String email) {
        SimpleMailMessage message = new SimpleMailMessage();
        message.setSubject("欢迎注册");
        message.setFrom("1039390833@qq.com");
        message.setTo(email);
        message.setText("欢迎开启共享工位之旅！");
        javaMailSender.send(message);
    }
}